home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Disc to the Future 2
/
Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin
/
MAC
/
THINKC
/
4_0
/
IAC_STUF
/
README
< prev
next >
Wrap
Text File
|
1989-11-29
|
2KB
|
47 lines
Simple Macintosh Interapplication Communication
The files in this folder implement an efficient, but very simple form of
interapplication communication. At the heart of the system is a simple driver
that responds to registration and lookup requests from applications. Buffer space
is allocated for each registered application and the lookup request simply returns a
pointer to that buffer space. All communcation between the applications is via direct
memory reads/writes to and from the assigned buffers and can therefore be extremely
efficient. How the buffer memory is used is completely up to the applications, but
I've included some C routines that support simple buffering for multiple messages.
Note that because of the simplicity of this scheme, the applications do have to be
reasonably cooperative. When an application (A) looks up another application (B) it
gets a pointer to a buffer. If application B later deregisters itself without first
telling A, then A could continue to use the invalid buffer pointer and possibly crash
the system.
Note that the driver tries to install itself in slot 29 and does not make any attempt
to check the unit table first to be sure that slot is not in use. This has never
caused me any problems but it's possible that someone out there would already have
something in that slot.
This folder contains the following files:
IAC-Driver.╣ and IAC-Driver.c:
Think C 4.0 project and source for the driver.
IAC:
The driver. Created by the IAC-Driver project. Copy the resources from this
file into your application's resource file. Make sure that the system heap flags
are set on the DATA and DRVR resources when you copy them.
IAC.c:
Convenient C routines for opening the driver and managing the buffers.
TestApp.╣, TestApp.╣.rsrc and TestApp:
Simple application for testing out the interapplication communication. Make
another copy of TestApp, start them both up. Any messages typed in the window
of one of the applications will appear in the window of the other. Type 'quit'
to exit from both applications.
KillDriver.╣ and KillDriver:
Simple routine to remove close the driver and deallocate any buffers it might
have created.